﻿using MangoMes.Commont.DapperHelps;
using MangoMes.Commont.Domain.Jocker;
using MangoMes.Commont.DTOs;
using MangoMes.Commont.Infrastructures.Interfaces;
using Org.BouncyCastle.Asn1.Ocsp;
using System.Collections.Generic;

namespace MangoMes.Write.API.Applications.Login
{
    public  class Logincommonality
    {

        private readonly IBateRepository<RecordsLogin> __RecordsLogin;

        public Logincommonality(IBateRepository<RecordsLogin> recordsLogin)
        {
            __RecordsLogin = recordsLogin;
        }

        public int Loginaddget(string OperatorName,string OperatorTime,string PerformOperation)
        {

            var SuccessMessage = 0;
            try
            {
                var per = new RecordsLogin()
                {
                    Logsid =0,
                    OperatorName = OperatorName,
                    OperatorTime =OperatorTime,
                    PerformOperation = PerformOperation,
                };
                DapperHelper dapperHelper = new DapperHelper();
                string str = "insert login values(@Logsid,@OperatorName,@OperatorTime,@PerformOperation)";
                var koh =  __RecordsLogin.Add(str, per, dapperHelper.MangoMesWrite);
                if (koh != null)
                {
                    SuccessMessage = 1;
                }
            }
            catch (Exception)
            {

                throw;
            }


            return SuccessMessage;
        }






    }
}
